/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.smg.community.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.smg.community.model.*;
import com.smg.community.dao.*;
import com.smg.community.service.*;
import com.smg.community.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */

@Service
@Transactional
public class SmgMessageManager extends BaseManager<SmgMessage,java.lang.Integer>{

	private SmgMessageDao smgMessageDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setSmgMessageDao(SmgMessageDao dao) {
		this.smgMessageDao = dao;
	}
	public EntityDao getEntityDao() {
		return this.smgMessageDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(SmgMessageQuery query) {
		return smgMessageDao.findPage(query);
	}
	/**
	 * 获取未处理的添加好友的请求信息
	 * @param fromMemberId
	 * @param toMemberId
	 * @return
	 */
	public SmgMessage getUndealAddFriendMessage(Integer fromMemberId, Integer toMemberId
			) {
		return smgMessageDao.getUndealAddFriendMessage(fromMemberId,toMemberId);
	}
	public int getUnReadMessageCount(Integer memberId) {
		return smgMessageDao.getUnReadMessageCount(memberId);
	}
	public int getUnReadSystemMessageCount(Integer memberId) {
		// TODO Auto-generated method stub
		return smgMessageDao.getUnReadSystemMessageCount(memberId);
	}
	public void deleteReceiveMessage(String memberId, String mids) {
		smgMessageDao.deleteReceiveMessage(memberId,mids);
	}
	
}
